
$(function () {
    //加载表格数据
    methods.getTableData();
});

var data = {
    //页面对话框
    dialog: {
        show: false,
        loading: false,
        disabled: false,
        title: "信息"
    },
    //分页
    paging: {
        currentPage: 1,
        pageSize: 10,
        total: 11,
        tableData: []
    },
    //搜索
    search: {},
    //当前对象
    currentObj: {}
};

var methods = {
    //下载用户模板
    downloadUserTemplate: function(){
        window.location.href="/admin/user/downloadUserTemplate";
    },
    //添加或保存
    saveOrUpdate: function () {
        data.dialog.loading = true;
        setTimeout(function () {
            data.dialog.show = false;
        }, 1000)
    },
    //获取表格数据
    getTableData: function () {

    },
    //处理页面大小变化
    handleSizeChange: function (val) {
        data.paging.pageSize = val;
        data.paging.currentPage = 1;
        methods.getTableData();
    },
    //处理当前页面变化
    handleCurrentChange: function (val) {
        data.paging.currentPage = val;
        methods.getTableData();
    },
    //处理对话框关闭
    handleDialogClose: function () {
        data.dialog.loading = false;
        data.dialog.disabled = false;
        data.dialog.title = "信息";
        data.currentObj = {};
    }

};
var vm = new Vue({data: data, methods: methods}).$mount("#app");
